﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Data.OracleClient;
using picFilter.App_Code;
using System.Data;

namespace picFilter.Controllers
{
    public class remarksByTypeController : ApiController
    {
        // GET api/remarksbytype/5
        /// <summary>
        /// 根据证件类型获取评语
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public object Get(int id)
        {
            try
            {
                OracleParameter typeId = DBHelper.createParameter("typeId", OracleType.Int32, id);
                DataTable dt = DBHelper.ExecuteDataTable("Select remarkId From typeRemark Where typeId=:typeId", typeId);
                return dt;
            }
            catch (Exception ex)
            {
                return new { error = "获取资源失败！", syserror = ex.Message };
            }
        }
    }
}
